﻿
using dbvc.context.Project;
using dbvc.data;
using dbvc.Queries;
using NUnit.Framework;

namespace tdd.dbvc
{
    public partial class tests
    {
        [Test]
        [Category("project")]
        public void add_projects()
        {
            root_login();

            del_projects();

            new CreateProject(security.Principal, new db_project() { name = "X1", active = true }).Execute();
            new CreateProject(security.Principal, new db_project() { name = "X2", active = true }).Execute();
            new CreateProject(security.Principal, new db_project() { name = "X3", active = false }).Execute();

            Assert.AreEqual(3, GenericQuery<db_project>.Count());
        }

        [Test]
        [Category("project")]
        public void del_projects()
        {
            root_login();

            new DeleteProject(security.Principal, GenericQuery<db_project>.GetAll()).Execute();

            Assert.AreEqual(GenericQuery<db_project>.Count(), 0);
        }
    }
}
